<?php
namespace WebApper\Shortcode;

/*
 * [dashboard id='dashboard']
 *
 */
class Dashboard extends \WebApper\Shortcode {
	
    /**
     * Define shortcode properties
     *
     */
	protected $shortcode = 'dashboard';
	protected $defaults = array(
		'id' => null,					// The unique ID to use for the shortcode. Default: none. Required.
	);

    /**
     * Handles the add post shortcode
     *
     * @param array $atts
     */
    public function shortcode( $atts ) {

		// Get shortcode attributes
			extract( shortcode_atts( $this->defaults, $atts ) );

		// Check for required shortcode attributes
			$msg = $this->has_req_attrs( $atts );
			if ( $msg !== true )
				return $msg;
				
		// Ouput Dashboard HTML
			?>
            <div class="row">
            
            	<div class="span6">
                	<h5>Leads</h5>
                	<?php do_shortcode("[recordindexphonestaff id='lead_index_widget' usercap='edit_posts' widget=true tableclasses='table-bordered,table-striped,table-condensed' posttype='lead' include='first-name,last-name,phone-mobile,lead-status' linkedfield='first-name']"); ?>
                </div>
                
            	<div class="span6 pull-right">
                	<h5>Tasks</h5>
                	<?php do_shortcode("[task_box id='taskBox' widget=true]"); ?>
                </div>
                
            </div>
            <?php
	}

}

$initialize = new Dashboard(); 

?>